<template>
	<div class="coupon">
		<myheader :type_title="type_title" :title="title"></myheader>
		<div class="nav">
			<span @click="tabs(index)" v-bind:class="{'active':act==index}" v-for="(tab,index)  in tabarr">{{tab}}</span>
		</div>
		<!--未使用-->
		<div class="info-WSY" v-show="str[0]">
			<div><span></span></div>
			<p>没有优惠券哦，赶紧去领吧~</p>
		</div>
		<!--已使用-->
		<div class="info-YSY" v-show="str[1]">
			<div><span></span></div>
			<p>没有优惠券哦，赶紧去领吧~</p>
		</div>
		<!--已失效-->
		<div class="info-YSX" v-show="str[2]">
			<ul>
				<li>
					<div class="YSX-s">
						<span>企悦卡</span>
						<p>卡号：14569823645876</p>
						<p>领卡时间：2012.12.12 12:12:12</p>
					</div>
					<div class="YSX-x">
						<span>1000元</span>
						<p>(含个税)</p>
					</div>
					<img src="../../../static/image/icon.png" />
				</li>
				<li>
					<div class="YSX-s">
						<span>企悦卡</span>
						<p>卡号：14569823645876</p>
						<p>领卡时间：2012.12.12 12:12:12</p>
					</div>
					<div class="YSX-x">
						<span>1000元</span>
						<p>(含个税)</p>
					</div>
					<img src="../../../static/image/icon.png" />
				</li>
				<li>
					<div class="YSX-s">
						<span>企悦卡</span>
						<p>卡号：14569823645876</p>
						<p>领卡时间：2012.12.12 12:12:12</p>
					</div>
					<div class="YSX-x">
						<span>1000元</span>
						<p>(含个税)</p>
					</div>
					<img src="../../../static/image/icon.png" />
				</li>
			</ul>
		</div>
	</div>
</template>

<script>
	import myheader from '@/components/user/myheader'
	export default {
		name: "coupon",
		data() {
			return {
				title: "我的优惠券",
				type_title: "noright",
				tabarr:["未使用","已使用","已失效"],
				act:0,
				str:[true,false,false]
			}
			
		},
		methods: {
			tabs(index){
				this.act=index;
				for(var i=0;i<3;i++){
					this.str[i]=false
				}
				this.str[index]=true
			}
		},
		components: {
			myheader
		}
	};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
	.coupon {
		width: 100%;
		height: auto;
		background: #F1F1F1;
	}
	
	.nav {
		width: 100%;
		height: 0.7rem;
		display: flex;
		justify-content: space-around;
		align-items: center;
		margin-top: 0.03rem;
		background: white;
	}
	
	.nav span {
		display: inline-block;
		width: auto;
		height: 100%;
		font-size: 0.25rem;
		line-height: 0.7rem;
	}
	
	.nav .active {
		border-bottom: 3px solid #ead884;
		box-sizing: border-box;
	}
	
	.info-WSY {
		width: 100%;
		height: 5rem;
		padding: 0.3rem;
		box-sizing: border-box;
	}
	
	.info-WSY div {
		width: 100%;
		height: 1.5rem;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	.info-WSY span {
		width: 1.35rem;
		height: 1.15rem;
		background: url(../../../static/image/no_data.png) no-repeat;
		background-size: 100%;
	}
	
	.info-WSY p {
		width: 100%;
		height: 1.5rem;
		text-align: center;
		line-height: 1rem;
		color: #999999;
		font-size: 0.3rem;
	}
	
	.info-YSY {
		width: 100%;
		height: 5rem;
		padding: 0.3rem;
		box-sizing: border-box;
	}
	
	.info-YSY div {
		width: 100%;
		height: 1.5rem;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	.info-YSY span {
		width: 1.35rem;
		height: 1.15rem;
		background: url(../../../static/image/no_data.png) no-repeat;
		background-size: 100%;
	}
	
	.info-YSY p {
		width: 100%;
		height: 1.5rem;
		text-align: center;
		line-height: 1rem;
		color: #999999;
		font-size: 0.3rem;
	}
	
	.info-YSX {
		width: 100%;
		height: auto;
		padding: 0 0.3rem;
		box-sizing: border-box;
		background: white;
	}
	
	.info-YSX ul {
		width: 100%;
		height: auto;
	}
	
	.info-YSX li {
		width: 100%;
		height: 2rem;
		background: #F1F1F1;
		border-radius: 0.1rem;
		display: flex;
		justify-content: flex-start;
		align-items: center;
		position: relative;
		margin-bottom: 0.2rem;
	}
	
	.YSX-s {
		width: 4.2rem;
		height: 100%;
	}
	
	.YSX-s span {
		display: inline-block;
		width: 1.3rem;
		height: 0.5rem;
		margin: 0.2rem 0;
		line-height: 0.5rem;
		text-indent: 0.1rem;
		color: white;
		font-size: 0.3rem;
		background: #d9d9d9;
		border-top-right-radius: 25px;
		border-bottom-right-radius: 25px;
	}
	
	.YSX-s p {
		width: 100%;
		height: 0.3rem;
		color: white;
		font-size: 0.25rem;
		line-height: 0.3rem;
		text-indent: 0.1rem;
	}
	
	.YSX-x {
		width: 2.4rem;
		height: 100%;
	}
	
	.YSX-x span {
		display: inline-block;
		width: 100%;
		height: auto;
		color: white;
		font-size: 0.6rem;
		text-align: right;
	}
	
	/*.YSX-x img {
		width: 1.35rem;
		height: 1.15rem;
	}*/
	
	.YSX-x p {
		width: 100%;
		text-align: right;
		font-size: 0.2rem;
		color: white;
	}
	
	img {
		position: absolute;
		width: 1.65rem;
		height: 1.65rem;
		right: 0.1rem;
	}
</style>